package T_fanxing_Demo;

/**
 * @author ChenYongHao
 * @date 2023/4/28 9:43
 * @desc 泛型接口
 */
// 修饰符 interface 接口名<类型> { }
interface GenericInterface<T> {
    void show(T t);
}

class  GenericInterfaceImpl<T> implements GenericInterface<T> {
    @Override
    public void show(T t) {
        System.out.println(t);
    }
}

public class T_interface_Demo {
    public static void main(String[] args) {
        GenericInterfaceImpl<String> g1 = new GenericInterfaceImpl<String>();
        g1.show("String");
        GenericInterfaceImpl<Integer> g2 = new GenericInterfaceImpl<Integer>();
        g2.show(30);
        GenericInterfaceImpl<Boolean> g3 = new GenericInterfaceImpl<Boolean>();
        g3.show(true);
    }
}
